package org.learn.spring5.service.impl;

import org.learn.spring5.dao.UserDao;
import org.learn.spring5.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;
    public void transferAccount() {

        //小明转账100，减少100元
        userDao.reduceMoney();
        int i = 10/0;
        //小红账户增加100元
        userDao.addMoney();
    }
}
